package Test;


import Book.BookList;
import User.User;
import User.AdminUser;
import User.NormalUser;

import java.util.Scanner;

public class Main {
    public static User login() {
        Scanner scan = new Scanner(System.in);
        System.out.println("您的姓名是->");
        String name = scan.next();
        System.out.println("请选择你要登录的系统->");
        System.out.println("1、管理员系统");
        System.out.println("2、读者系统");
        System.out.println("————————————————————");
        int choice = scan.nextInt();
        if(choice == 1) {
            return new AdminUser(name);
        }
        else {
            return new NormalUser(name);
        }
    }

    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user = login();
        while (true) {
            int choice = user.menu();
            user.doOperation(choice,bookList);
        }
    }
}